This invention relates to electrical computer and digital processing systems and specifically to the storage/relocation of programs and/or operating systems. Such storage and relocation has application in the field of copier/printer devices, and in other ROM-based embedded applications.
Embedded computer systems usually perform faster when executing out of random-access-memory (RAM), rather than when executing out of the read-only memory (ROM) in which the programs are stored, because of the reduced wait states of RAM vs. ROM. There is, however, no known prior art which allows operating systems to conditionally, or dynamically, execute out of RAM to take advantage of systems with large amounts of memory. Known systems are configured to execute from either ROM or RAM, exclusively.
Techniques are known which use dynamically configuring address lines to utilize faster memory, or to utilize hardware registers to facilitate relocation of programs, but such systems have not addressed dynamically relocating the ROM image of a program into RAM for faster execution.
Hardware support is another technique used to solve the problems of relocating a program""s code and data. Some processors and IC boards provide the capability of loading dedicated relocation registers with offset values, which are then used when memory references are executed by the program. U.S. Pat. No. 4,138,738 to Drogichen, granted Feb. 6, 1979, for Self-contained relocatable memory subsystem, describes one such system.
Another technique, known as xe2x80x9cPosition Independent Code (PIC)xe2x80x9d or xe2x80x9cPosition Independent Data (PID),xe2x80x9d relies upon the processor providing position independent instructions, i.e., allowing code and data access independent of where in memory the program is executing. While similar to the technique of U.S. Pat. No. 4,138,738, the registers used for PIC and PID are general purpose registers, usually located within the processor, rather than dedicated internal or external registers.
In the technique known as xe2x80x9cTraditional Relocation,xe2x80x9d the program is stored in an interim state in ROM, having the information contained therein which is required used when the program is loaded into RAM. The information is used by the relocating loader to modify those parts of the program""s code and data which are dependent upon where the program is loaded into memory. The image stored in ROM is itself not executable; it is only executable after it has been positioned in RAM and the relocation values adjusted.
U.S. Pat. No. 5,029,078 to Iwai, granted Jul. 2, 1991, for Program loading method with relocation address, describes a method in the non-embedded environment, providing for dynamic relocation of a program within a disc-based operating system. The application is stored in a relocatable format, not in an executable format. The relocation occurs only with operator intervention to support other transient programs, rather than a relocation based upon execution from faster RAM memory, an assessment made dynamically during the system initialization.
In a computer system having an embedded application, a method of dynamic system relocation, including creating a ROM version of an embedded application which is executable from ROM; creating a RAM version of the embedded application which is executable from RAM; comparing the RAM version of the embedded application to the ROM version of the embedded application to identify differences between the RAM version and the ROM version; storing the differences between the ROM version and the RAM version in a relocation table; storing the ROM version of the embedded application and the relocation table in ROM; on system initialization; conditionally copying the ROM version of the embedded application into RAM; modifying the copied ROM version now in RAM as a function of the differences stored in the relocation table; and executing the embedded application from the RAM version of the embedded application.
It is an object of this invention to provide a system which has knowledge of its configuration in either a ROM or RAM target.
Another object of the invention is to provide a system having an intelligent startup code which may assess the amount of system memory, which if suitably large, e.g., 32 MByte or greater, make a copy of itself in RAM, relocate the data and execute from the RAM image.
A further object of the invention is to provide a copier/printer device having a dynamic system relocation capability.